﻿package log;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Calendar;

public class LogController {
	
	private File log;
	
	public LogController(){
		Calendar c = Calendar.getInstance();
		this.log = new File("logs/"+c.getTime().toString()+".txt");
	}
	
	//Escribe un mensaje de "data" en el log
	private void write(String data){
		try{           
			FileWriter writer = new FileWriter(log, true);
			writer.write(data);
			writer.flush();
			writer.close();
		} catch (IOException e){
           e.printStackTrace();
        }
	}

}
